﻿@model RoadFlow.Model.FlowComment
<form method="post">
    @Html.AntiForgeryToken()
    <br />
    <input type="hidden" name="Id" value="@Model.Id" />
    <input type="hidden" name="AddType" value="@Model.AddType" />
    <table cellpadding="0" cellspacing="1" border="0" width="99%" class="formtable">
        <tr>
            <th>意见：</th>
            <td>
                <textarea class="mytext" name="Comments" id="Comments" validate="empty" style="width:75%; height:60px;">@Model.Comments</textarea>
            </td>
        </tr>
        @if (!"1".Equals(ViewData["isOneSelf"].ToString()))
        {
            <tr>
                <th style="width: 80px;">使用人：</th>
                <td>
                    <input type="text" name="UserId" id="UserId" isChangeType="0" unit="0" dept="0" station="0" group="0" user="1" class="mymember" value="u_@Model.UserId" style="width:60%" /> //为空表示给所有人员
                </td>
            </tr>
        }
        else
        {
            <input type="hidden" name="UserId" value="@Model.UserId" />
        }
            <tr>
                <th style="width: 80px;">序号：</th>
                <td>
                    <input type="text" name="Sort" id="Sort" class="mytext" validate="int" value="@Model.Sort" />
                </td>
            </tr>
        </table>
    <div class="buttondiv">
        <input type="button" value="确定保存" class="mybutton" onclick="checkform(this);" />
        <input type="button" class="mybutton" value="取消关闭" style="margin-left: 5px;" onclick="new RoadUI.Window().close();" />
    </div>
</form>
<script type="text/javascript">
    $(window).load(function () {

    });
    function checkform(but)
    {
        var f = document.forms[0];
        if (new RoadUI.Validate().validateForm(f))
        {
            var o = RoadUI.Core.serializeForm($(f));
            $(but).prop("disabled", true);
            $.ajax({
                url: "Save@(Html.Raw(ViewData["queryString"]))", data: o, type: "post", success: function (text)
                {
                    if (RoadUI.Core.checkLogin(text, false))
                    {
                        alert(text);
                    }
                    $(but).prop("disabled", false);
                    new RoadUI.Window().reloadOpener();
                    new RoadUI.Window().close();
                }
            });
        }
    }
</script>